package com.howard.modules.user.service;

import javax.annotation.Resource;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;

import com.howard.modules.user.User;

@Service
public class MyUserDetailService implements UserDetailsService{

	@Resource
	private UserService userService;
	
	@Override
	public UserDetails loadUserByUsername(String username)
			throws UsernameNotFoundException {
		//此处根据username通过数据库查询用户
		User user=userService.queryUserByName(username);
		return user;
	}
}
